package com.coding.kan_yi_dao.controller;


import com.coding.kan_yi_dao.common.Result;
import com.coding.kan_yi_dao.entity.GoodsLike;
import com.coding.kan_yi_dao.service.impl.GoodsLikeServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 砍一刀，不买就砍你一刀
 * @since 2023-09-20
 */
@Api(tags = "商品推荐")
@RestController
@RequestMapping("/goods-like")
@CrossOrigin
public class GoodsLikeController {

    @Resource
    GoodsLikeServiceImpl goodsLikeService;

    //TODO 查询
    @ApiOperation(value = "全查询")
    @GetMapping("/go_select/like")
    public Result go_select(GoodsLike goodsLike) {
        return goodsLikeService.go_select(goodsLike);
    }

    //TODO 修改
    @ApiOperation(value = "修改")
    @GetMapping("/go_update/like")
    public Result go_update(GoodsLike goodsLike) {
        return goodsLikeService.go_update(goodsLike);
    }

    //TODO 添加
    @ApiOperation(value = "添加")
    @GetMapping("/go_insert/like")
    public Result go_insert(GoodsLike goodsLike) {
        return goodsLikeService.go_insert(goodsLike);
    }

    //TODO 删除
    @ApiOperation(value = "删除")
    @GetMapping("/go_delete/like")
    public Result go_delete(@RequestParam(value = "ids",required = false) List<Integer> ids){
        return goodsLikeService.go_delete(ids);
    }
}
